package Sort2;

import java.util.Arrays;

public class Bubble {
    public static void main(String[] args) {
        int[] arr={5,9,8,1,1,5,4};
        bubble(arr);
        System.out.println(Arrays.toString(arr));
    }
    public static void bubble(int[] arr){
        for(int bound=0;bound<=arr.length;bound++){
            for(int cur=arr.length-1;cur>bound;cur--){
                if(arr[cur]<arr[cur-1]){
                    int temp=arr[cur];
                    arr[cur]=arr[cur-1];
                    arr[cur-1]=temp;
                }
            }
        }
    }
}
